import request from "@/utils/request";

export default{
  //获取所有角色
  getAllRoleApi(name) {
    return request({
      url:'/role/getAllRole',
      method:'get',
      params:{
        roleName:name
      }
    })
  },

  //编辑/新增
  updateAndSaveApi(form) {
    return request({
      url:'/role/updateAndSave',
      method:'post',
      data:form
    })
  },

  //根据id删除
  delDataApi(id) {
    return request({
      url:`/role/delDataById/${id}`,      //resful风格
      method:'delete',
    })
  },

  delDataByIdsApi(ids) {
    return request({
      url:`/role/delDataByIds`,
      method:'post',
      data:ids
    })
  },
  getMenusApi() {
    return request({
      url:`/menu/getMenus`,
      method:'get',
    })
  },
  saveRoleMenuApi(menusForm) {
    return request({
      url:`/menu/saveRoleMenu`,
      method:'post',
      data:menusForm
    })
  }
}
